<script>
import {commonStorage} from "@/utils/common.js";
import {getConfigApi} from "@/apis/user.js";
import Vconsole from 'vconsole'

export default {
  async onLaunch() {
    this.getConfig();

    // #ifdef H5
    var script = document.createElement("script");
    script.src = "http://res.wx.qq.com/open/js/jweixin-1.6.0.js";
    document.body.appendChild(script);

    var script1 = document.createElement("script");
    script1.src =
        "https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js";
    document.body.appendChild(script1);
    // #endif
  },

  onShow: function () {
    // #ifdef H5
    const {consoles} = this.$route.query
      if (consoles === 'true'){
        new Vconsole()
      }

    // #endif
  },
  onHide: function () {
  },
  methods: {
    async getConfig() {
      let {code, data} = await getConfigApi();
      if (code == 1) {
        commonStorage.setStorage("currentStatus", data.flag);
      }
    }
  },
  onShareAppMessage(options) {
    return {
      title:'开心测',
      path:'/pages/index/index',
      imageUrl:'https://www.ai-sbbs.xyz/logo.png'
    }
  }
};
</script>

<style lang="scss">
//page {
//  height: 100vh;
//  width: 100%;
//  display: flex;
//  flex-direction: column;
//}

*{
  box-sizing: border-box;
}
</style>
